# 代码所有：cxw
# 开发时间：2021/11/11 19:22

#FileNotFoundError 异常,找不文件，不存在的文件，解决异常时需要将try语句放在open()语句之前
'''filename="alice.txt"
with open(filename) as files:
    contests=files.read()
    print(contests)
'''

#解决FileNotFoundError异常
filename="alice.txt"
try:
    with open(filename) as files:
        contests = files.read()
except FileNotFoundError:
    print("文件找不到")
else:
    print(contests)



